<template>
	<view class="safe">
		<view class="set-list">
			<view class="list_li" v-for="(item,index) in mylist" @tap="gopath(item)">
				<view class="li-left">
					<text class="left-text">{{t(item.text)}}</text>
				</view>
				<image src="@/static/imgs/my/arrow_right.png" mode="" class="li-right"></image>
			</view>

		</view>

	</view>
</template>

<script setup>
	import {
		useI18n
	} from "vue-i18n";
	const {
		t
	} = useI18n()
	uni.setNavigationBarTitle({
		title: t('user.aboutUs')
	});
	const mylist = [{
			text: 'user.UserAgreement',
			path: 'webview',
			zh_url: 'https://app.anfujia.info/api/static/agreement/用户协议.html',
			en_url: 'https://app.anfujia.info/api/static/agreement/用户协议-(英).html',
			tc_url: 'https://app.anfujia.info/api/static/agreement/用户协议-(繁).html',

		},
		{
			text: 'user.privacyagreement',
			path: 'webview',
			zh_url: 'https://app.anfujia.info/api/static/agreement/隐私政策.html',
			en_url: 'https://app.anfujia.info/api/static/agreement/隐私政策-(英).html',
			tc_url: 'https://app.anfujia.info/api/static/agreement/隐私政策-(繁).html',

		},


	]
	const unopen = () => {
		uni.showToast({
			icon: 'none',
			title: t('user.Notopenyet'),
		});
	}

	const gopath = (item) => {
		let url = ''
		if (!item.path) return unopen()
		if (item.path) {
			if (uni.getStorageSync('Lang') == 'zh-Hans') {
				url = item.zh_url
			} else if (uni.getStorageSync('Lang') == 'en') {
				url = item.en_url
			} else if (uni.getStorageSync('Lang') == 'zh-Hant') {
				url = item.tc_url
			} else {
				url = item.zh_url
			}
			uni.navigateTo({
				url: item.path + '?url=' + url,
			});
		}
	}
</script>

<style scoped lang="scss">
	.safe {
		width: 100%;
		min-height: 100vh;
		background-color: #F2F4F7;
		padding-top: 16rpx;
	}

	.logout {
		background-color: #fff;
		margin-top: 16rpx;
		width: 100%;
		height: 104rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 16px;
		font-weight: 500;
		letter-spacing: 0px;
		line-height: 22.4px;
		color: rgba(212, 48, 48, 1);
	}

	.set-list {


		width: 100%;
		padding: 36rpx;
		padding-bottom: 0;
		padding-top: 0;
		opacity: 1;

		background: #fff;

		.list_li:last-child {
			border-bottom: none;
		}

		.list_li {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: space-between;
			box-sizing: content-box;
			padding-top: 36rpx;
			padding-bottom: 36rpx;
			border-bottom: 1px solid rgba(242, 244, 247, 1);

			.li-right {
				height: 26rpx;
				width: 14rpx;

			}

			.li-left {
				display: flex;
				align-items: center;

				.left-icon {
					width: 40rpx;
					height: 40rpx;
					margin-right: 12rpx;
				}

				.left-text {
					font-size: 16px;
					font-weight: 500;
					letter-spacing: 0px;
					line-height: 22.4px;
					color: rgba(15, 24, 40, 1);
				}
			}
		}
	}
</style>